Skip to content

[APPS] Add e2e test and frontend/ archive prefix for apps plugin#290

Merged
sarenji merged 6 commits intomasterfrom
sdkennedy2/apps-plugin-e2e-test
Mar 17, 2026
Merged

[APPS] Add e2e test and frontend/ archive prefix for apps plugin#290
sarenji merged 6 commits intomasterfrom
sdkennedy2/apps-plugin-e2e-test

Conversation

@sdkennedy2
Copy link
Collaborator

@sdkennedy2 sdkennedy2 commented Mar 16, 2026

Motivation

Prepares the apps plugin archive structure for the upcoming backend functions feature. The downstream branch (sdkennedy2/apps-backend-functions-upload-v2) expects frontend assets to live under a frontend/ subdirectory in the upload archive, alongside backend/ for backend function outputs. This PR moves that prefixing into the parent branch so the archive structure is consistent regardless of whether backend functions are present.

The backend API endpoint has already been updated to accept frontend assets in a subfolder, so this change is safe to land independently.

Changes

  • Archive structure: All collected assets are now prefixed with frontend/ before being added to the upload archive. Previously, assets were placed at the root of the zip.
  • E2e test: Added an e2e test that builds the apps plugin fixture, verifies the upload request is sent correctly, and extracts the uploaded zip to assert all files live under frontend/.
  • Unit test: Updated createArchive assertions to expect the frontend/-prefixed paths.

QA Instructions

  1. Run yarn test:unit packages/plugins/apps — all unit tests should pass
  2. Run yarn test:e2e packages/tests/src/e2e/appsPlugin --project "chrome | webpack" — e2e tests should pass, including the new archive structure verification

Blast Radius

  • Only affects the apps plugin upload archive structure. No other plugins are impacted.
  • The change is behind the apps.enable config flag, so no impact to users who don't use the apps plugin.
  • The backend API already supports the frontend/ subfolder structure, so no coordination with backend deploys is needed.

Documentation

Copy link
Collaborator Author

sdkennedy2 commented Mar 16, 2026

@sdkennedy2 sdkennedy2 changed the title Add e2e test for apps plugin [APPS] Add e2e test for apps plugin Mar 16, 2026
@sdkennedy2 sdkennedy2 changed the title [APPS] Add e2e test for apps plugin [APPS] Add e2e test and frontend/ archive prefix for apps plugin Mar 16, 2026
@sdkennedy2 sdkennedy2 requested a review from sarenji March 16, 2026 23:29
body: typeof body === 'string' ? body : JSON.stringify(body),
};
// Write to a known location so all workers can read it.
const outDir = path.resolve(__dirname, '..', '..', '_playwright', 'public', 'appsPlugin');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does running the test output a file into this folder, and is this file tracked by git? Couldn't we create a temporary folder instead?


About mocking in general, looking at how Playwright mocks requests, seems like we could also handle it via page.route, including a page.waitForResponse to monitor the network call and verify the response. More detailed documentation in their Network page.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call 👍. I can take a look at this.

DD_ENV: ci

e2e:
timeout-minutes: 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an explanation for this increase?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e CI/CD job is very flaky. It can take between 5-30 minutes. It seems primarily because it can take a while to install playwright if it isn't cached.

Copy link
Contributor

@sarenji sarenji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

If the upload-capture.json file is not tracked by git after running the e2e test locally then this is fine to merge. If not then I'd encourage pursuing one of the solutions I commented about.

@sarenji sarenji merged commit 1f0e9db into master Mar 17, 2026
4 checks passed
@sarenji sarenji deleted the sdkennedy2/apps-plugin-e2e-test branch March 17, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants